/**      
 * @file		enumerations2.cpp
 * @description		Demonstrates the use of enumerations. Notice how
 *			we set the value for the freeways. Also, check out
 *			the if/else if/else statements. Pretty slick of C++!
 * @course		CSCI 123 Section 00000
 * @assignment		Sample 17
 * @date		mm/dd/yyyy
 * @author		Brad Rippe (00000000) brippe@fullcoll.edu
 * @version		1.0
 */
#include <iostream>
using namespace std;

/**
 * @return zero if the application executes successfully
 */
int main() {
	enum Speed	{ FAST, NORMAL, SLOW };
	enum Freeway 	{ NINETY_ONE = 91, FOUR_O_FIVE = 405, 
		           ONE_O_ONE = 101, TWENTY_TWO = 22 };

	Speed speed;
	Freeway freeway;
	int ans = 0;

	cout << "Please tell me what freeway you're driving on?\n";
	cout << "type 91 for the 91, 405 for the 405, 101 for the 101,";
	cout << " or 22 for the 22\n";
	cin >> ans;

	if(ans == NINETY_ONE) {
		freeway = NINETY_ONE;
	} else if(ans == FOUR_O_FIVE) {
		freeway = FOUR_O_FIVE;
	} else if(ans == ONE_O_ONE) {
		freeway = ONE_O_ONE;
	} else if(ans == TWENTY_TWO) {
		freeway = TWENTY_TWO;
	} else {
		cout << "You have given me an incorrect freeway, bye!\n";
		return 0;	// I can terminate the application any time
				// I feel the user isn't playing nice
	}

	cout << "Please tell me how fast you plan on driving?\n";
	cout << "type 0 for fast, 1 for normal, 2 for slow\n";
	cin >> ans;

	if(ans == FAST) {
		speed = FAST;
	} else if(ans == NORMAL) {
		speed = NORMAL;
	} else if(ans == SLOW) {
		speed = SLOW;
	} else {
		cout << "You have given me an incorrect speed, bye!\n";
		return 0;
	}

	cout << "You're driving on the " << freeway << endl;
	cout << "You're traveling ";
	if(speed == FAST) {
		cout << " FAST (move to the left)!\n";
	} else if(speed == NORMAL) {
		cout << " the speed limit (good boy)!\n";
	} else {
		cout << " slow (move to right)!\n";
	}
	return 0;
}
